# ~*~ coding: utf-8 ~*~

from apps.blueprints import ops_blueprint
from .views import CeleryTaskLogAPI, CeleryTaskResultAPI, CeleryTaskLogView, \
    TasKListAPI, TasKListView, AdHocListAPI, AdHocListView, HistoryListAPI, HistoryListView


ops_blueprint.add_url_rule('/api/celery/task/<uuid:pk>/result/',
                           view_func=CeleryTaskResultAPI.as_view('api-celery-task-result'))
ops_blueprint.add_url_rule('/api/celery/task/<uuid:pk>/log/',
                           view_func=CeleryTaskLogAPI.as_view('api-celery-task-log'))
ops_blueprint.add_url_rule('/celery/task/<uuid:pk>/log/',
                           view_func=CeleryTaskLogView.as_view('celery-task-log'))

ops_blueprint.add_url_rule('/api/task/', view_func=TasKListAPI.as_view('api-task-list'))
ops_blueprint.add_url_rule('/task/', view_func=TasKListView.as_view('task-list'))
ops_blueprint.add_url_rule('/api/adhoc/', view_func=AdHocListAPI.as_view('api-adhoc-list'))
ops_blueprint.add_url_rule('/adhoc/', view_func=AdHocListView.as_view('adhoc-list'))
ops_blueprint.add_url_rule('/api/history/', view_func=HistoryListAPI.as_view('api-history-list'))
ops_blueprint.add_url_rule('/history/', view_func=HistoryListView.as_view('history-list'))
